{include file='Public/header' /}
<div class="layui-layout layui-layout-admin">
{include file='Public/head' /}	
{include file='Public/side' /}
<div class="layui-body"> 
{include file='Public/crumbs' /}
	<!-- 内容主体区域 -->
	<div class="shu-body">
		<div class="layui-fluid">
			<div class="layui-row layui-col-space15">
				<div class="layui-col-md12 layui-col-xs12">
					<form class="layui-form" method="post">
						<a href="{:Url('add')}" class="layui-btn"><i class="layui-icon">&#xe61f;</i> 添加</a>
						<table lay-even class="layui-table">
							<colgroup>
							<col>
							</colgroup>
							<thead>
								<tr>
									<th>变量说明</th>
                                	<th>变量名称</th>
                                	<th>调用说明</th>
                                	<th>变量值</th>
                                	<th>操作</th>
								</tr>
							</thead>
							<tbody>
							{volist name="vars" id="val"}
							<tr>
								<td>{$val['name']}</td>
                                <td>{$val['k']}</td>
                                <td>
                                        {literal}{$Think.CONFIG.{/literal}
                                        {$val.k}
                                        {literal}}{/literal}
                                </td>
                                <td>{$val['v']}</td>
								<td>
								<a class="layui-btn layui-btn-small" href="{:url('edit',array('k'=>$val['k']))}">修改</a>
								<a class="layui-btn layui-btn-small layui-btn-danger del_btn"  href="javascript:;" nickname="{$val['name']}" val="{:url('del',array('k'=>$val['k']))}">删除</a> 
								 
								</td>
							</tr>
							{/volist}
							</tbody>
						</table>
					</form>
				</div>
			</div>
		</div>
	</div>
	<!-- 内容主体区域 END--> 
</div>
{include file='Public/footer' /} 
<script>
layui.use('form',function(){
  var form = layui.form,
  jq = layui.jquery;
 
 
  jq('.del_btn').click(function(){
	var name = jq(this).attr('nickname');
    var url = jq(this).attr('val');
    layer.confirm('确定删除【'+name+'】?', function(index){
      loading = layer.load(2, {
        shade: [0.2,'#000']
      });
      jq.get(url,function(data){
        if(data.code == 1){
          layer.close(loading);
          layer.msg(data.msg, {icon: 1, time: 1000}, function(){
            location.reload();
          });
        }else if(data.code == 0){
          layer.close(loading);
          layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
        }
      });
    });   
  });


 
})
</script> 
